<script setup lang="ts"></script>

<template>
  <main class="home-page">
    <div class="manual-btn-container">
      <NuxtLink
        to="https://wiki.17u.cn/wiki?fid=d66eff8328b142749f23b86422f4f03a"
        target="__blank"
      >
        <button class="floating-manual-btn" aria-label="打开使用手册">
          <div class="btn-content">
            <svg class="icon" viewBox="0 0 24 24">
              <path
                d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"
              />
            </svg>
            <span class="pulse-dot"></span>
            <span class="btn-text">使用手册</span>
          </div>
        </button>
      </NuxtLink>
    </div>
    <NuxtLink to="/table-diagraming">
      <section class="item-box">
        <figure class="icon-box">
          <img src="../assets/imgs/icons/table.svg" alt="" />
        </figure>
        <h1 class="title">Table数据列表</h1>
        <p class="details">表格数据呈现，分页，检索查询，弹窗查看...</p>
      </section>
    </NuxtLink>

    <section class="item-box">
      <figure class="icon-box">
        <img src="../assets/imgs/icons/form.svg" alt="" />
      </figure>
      <h1 class="title">提交表单页面</h1>
      <p class="details">表格，提交，修改，校验...</p>
    </section>
  </main>
</template>

<style lang="scss" scoped>
.home-page {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 296px;
  width: 100vw;
  height: 100vh;
  padding: 75px 150px;
  gap: 16px;
  .item-box {
    height: 100%;
    border-radius: 12px;
    padding: 24px;
    background-color: #f9f9f9;
    border: 1px solid #f9f9f9;
    cursor: pointer;
    figure {
      display: flex;
      justify-content: center;
      align-items: center;
      margin-bottom: 20px;
      border-radius: 6px;
      background-color: #e5e5e5;
      width: 48px;
      height: 48px;
      font-size: 24px;
    }
    .title {
      line-height: 24px;
      font-size: 16px;
      font-weight: 600;
    }
    .details {
      padding-top: 8px;
      line-height: 24px;
      font-size: 14px;
      font-weight: 500;
      color: rgba(60, 60, 60, 0.7);
    }
  }
  .manaul {
    grid-column: span 3;
    iframe {
      width: 100%;
      height: 100vh;
      border-radius: 12px;
    }
  }
}
.manual-btn-container {
  position: fixed;
  left: 30px;
  top: 0;
  height: 300px;
  display: flex;
  align-items: flex-end;
  z-index: 999;
}

.floating-manual-btn {
  height: 80px;
  width: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
  border: none;
  box-shadow: 0 10px 20px rgba(255, 107, 107, 0.3), 0 6px 6px rgba(255, 107, 107, 0.2),
    inset 0 -3px 5px rgba(0, 0, 0, 0.1), inset 0 3px 5px rgba(255, 255, 255, 0.2);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: float 3s ease-in-out infinite;
}

.floating-manual-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 15px 30px rgba(255, 107, 107, 0.4), 0 10px 10px rgba(255, 107, 107, 0.3);
}

.btn-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.icon {
  width: 36px;
  height: 36px;
  fill: white;
}

.btn-text {
  color: white;
  font-weight: bold;
  font-size: 14px;
  margin-top: 5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pulse-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  background: #ffeb3b;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(255, 235, 59, 0.7);
  animation: pulse 2s infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 235, 59, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(255, 235, 59, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 235, 59, 0);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .manual-btn-container {
    height: 200px;
    right: 15px;
    bottom: 15px;
  }

  .floating-manual-btn {
    height: 60px;
    width: 60px;
  }

  .icon {
    width: 28px;
    height: 28px;
  }
}
</style>
